ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Partridge_Clutch Class Reference

The partridge clutch class. More...

#include <Partridge_All.h>

Inheritance diagram for Partridge_Clutch:
Partridge_Base TAnimal TALMaSSObject

Public Member Functions

virtual void Dying ()
 Generic dying handler. More...
 
void OnStartIncubating ()
 Flag under incubation. More...
 
virtual void BeginStep (void)
 Clutch BeginStep. More...
 
virtual void Step (void)
 ClutchStep. More...
 
virtual void EndStep (void)
 Clutch EndStep. More...
 
virtual bool DailyMortality ()
 Background mortality test. More...
 
virtual bool OnFarmEvent (FarmToDo event)
 Handle farm event. More...
 
void AgDying ()
 Killed by management. More...
 
void OnEaten ()
 Message handler. More...
 
void OnGivenUp ()
 Message handler. More...
 
void OnMumDead ()
 Message handler. More...
 
void SetClutchSize (int cs)
 Set no. eggs. More...
 
int GetClutchSize (void)
 Supply no eggs. More...
 
Partridge_FemaleGetMother (void)
 Supply mother pointer. More...
 
 Partridge_Clutch (int a_x, int a_y, Partridge_Female *a_mother, Partridge_Covey *a_flock, Landscape *a_map, int a_num_eggs, int a_family_counter, Partridge_Population_Manager *a_manager)
 Constructor. More...
 
virtual ~Partridge_Clutch (void)
 Destructor. More...
 
- Public Member Functions inherited from Partridge_Base
Partridge_Object GetObjectType ()
 Supply object type. More...
 
bool GetUncleStatus ()
 Supply uncle status. More...
 
void SetUncleStatus (bool a_Status)
 Set uncle status. More...
 
bool PossibleMate (Partridge_Base *a_partridge)
 Can we mate? More...
 
virtual bool ArePaired ()
 Overridden base function. More...
 
Partridge_CoveyGetCovey (void)
 Supply covey pointer. More...
 
Partridge_State GetState (void)
 Supply state. More...
 
void SetState (Partridge_State a_pars)
 Set state. More...
 
int GetFamily (void)
 Supply family ID. More...
 
int GetAge (void)
 Supply age. More...
 
void SetAge (int a_age)
 Set age. More...
 
long GetID (void)
 Supply ID. More...
 
void SetFamily (unsigned int family)
 Set family ID. More...
 
void SetCovey (Partridge_Covey *a_covey)
 Set covey pointer. More...
 
void MakeCovey ()
 Create our own covey. More...
 
void SwitchCovey (Partridge_Covey *a_covey)
 Swap coveys. More...
 
 Partridge_Base (int a_born_x, int a_born_y, int a_x, int a_y, int a_family_counter, Partridge_Covey *a_covey, Landscape *a_map, Partridge_Population_Manager *a_manager)
 Constructor for Partridge_Base. More...
 
virtual ~Partridge_Base (void)
 Destructor. More...
 
virtual void CopyMyself (int a_Ptype)
 Duplicate this object. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Private Member Functions

Partridge_State ClDeveloping (void)
 Development state. More...
 
void ClDying (void)
 Dying state. More...
 

Private Attributes

int m_clutch_size
 No. of eggs. More...
 
Partridge_Femalem_mother
 Pointer to mother. More...
 
bool m_underincubation
 Are we being incubated? More...
 

Additional Inherited Members

- Public Attributes inherited from Partridge_Base
Partridge_Population_Managerm_OurPopulationManager
 Pointer to the population manager. More...
 
- Protected Member Functions inherited from Partridge_Base
virtual void CheckMatePointers ()
 Debug. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 
- Protected Attributes inherited from Partridge_Base
int m_signal
 Used to pass information to outputs. More...
 
long m_id
 Individual bird ID. More...
 
int m_family_counter
 Family ID. More...
 
int m_age
 Age in days. More...
 
int m_born_x
 x-coord of birth More...
 
int m_born_y
 y-coord of birth More...
 
bool m_UncleStatus
 If has uncle status in the covey. More...
 
Partridge_Object m_object_type
 Type of pob object this is. More...
 
Partridge_Coveym_covey
 Pointer to the covey. More...
 
Partridge_State m_state
 Current behavioural state. More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

The partridge clutch class.

Constructor & Destructor Documentation

◆ Partridge_Clutch()

Partridge_Clutch::Partridge_Clutch ( int  a_born_x,
int  a_born_y,
Partridge_Female a_mother,
Partridge_Covey a_covey,
Landscape a_map,
int  a_num_eggs,
int  a_family_counter,
Partridge_Population_Manager a_manager 
)

Constructor.

The constructor. Ensures sensible values for attributes not set by the base constructor.

262  :
263  Partridge_Base( a_born_x, a_born_y, a_born_x, a_born_y, a_family_counter, a_covey, a_map, a_manager )
264  {
265  m_mother = a_mother;
266  m_clutch_size = a_num_eggs;
268  m_underincubation = false;
269 }
@ pob_Clutch
Definition: Partridge_All.h:297
Partridge_Object m_object_type
Type of pob object this is.
Definition: Partridge_All.h:418
Partridge_Base(int a_born_x, int a_born_y, int a_x, int a_y, int a_family_counter, Partridge_Covey *a_covey, Landscape *a_map, Partridge_Population_Manager *a_manager)
Constructor for Partridge_Base.
Definition: Partridge_All.cpp:156
Partridge_Female * m_mother
Pointer to mother.
Definition: Partridge_All.h:526
bool m_underincubation
Are we being incubated?
Definition: Partridge_All.h:528
int m_clutch_size
No. of eggs.
Definition: Partridge_All.h:524

References m_clutch_size, m_mother, Partridge_Base::m_object_type, m_underincubation, and pob_Clutch.

◆ ~Partridge_Clutch()

virtual Partridge_Clutch::~Partridge_Clutch ( void  )
inlinevirtual

Destructor.

575 {;}

Member Function Documentation

◆ AgDying()

void Partridge_Clutch::AgDying ( )

Killed by management.

This controls behaviour on the death of a clutch due to management. If the clutch is hit there is a very good chance that the hen dies too, so need to tell her.

365 {
366 
369  // The line below is really debug information, this identifies the caller
373  ClDying();
374 }
@ pcomm_ClutchMown
Definition: Partridge_Communication.h:65
Partridge_Population_Manager * m_OurPopulationManager
Pointer to the population manager.
Definition: Partridge_All.h:430
void ClDying(void)
Dying state.
Definition: Partridge_All.cpp:596
bool PassMessage(PartridgeCommunicationData *pc_data, TypeOfPartridge_Communication pc)
Pass a message.
Definition: Partridge_Communication.cpp:86
k_factors * m_Ourkfactors
Pointer to kfactors object.
Definition: Partridge_Population_Manager.h:169
Partridge_Communication m_messagecentre
Message class pointer.
Definition: Partridge_Population_Manager.h:163
PartridgeCommunicationData * m_comms_data
Message data.
Definition: Partridge_Population_Manager.h:161
population_attributes * m_ThisYear
Definition: Partridge_All.h:251
void incNoClutchesPredated()
Definition: Partridge_All.h:100
void incNoAgDeadClutches()
Definition: Partridge_All.h:164
Partridge_Female * m_female
Definition: Partridge_Communication.h:84
Partridge_Clutch * m_clutch
Definition: Partridge_Communication.h:80

References ClDying(), population_attributes::incNoAgDeadClutches(), population_attributes::incNoClutchesPredated(), PartridgeCommunicationData::m_clutch, Partridge_Population_Manager::m_comms_data, PartridgeCommunicationData::m_female, Partridge_Population_Manager::m_messagecentre, m_mother, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, k_factors::m_ThisYear, Partridge_Communication::PassMessage(), and pcomm_ClutchMown.

Referenced by OnFarmEvent().

◆ BeginStep()

void Partridge_Clutch::BeginStep ( void  )
virtual

Clutch BeginStep.

Does nothing more than check bacground mortalities and management mortalities.

Reimplemented from TAnimal.

283 {
284 
285  if ( !DailyMortality() ) CheckManagement();
286  else
287  {
288  ClDying();
289  }
290 }
virtual bool DailyMortality()
Background mortality test.
Definition: Partridge_All.cpp:354
void CheckManagement(void)
Definition: PopulationManager.cpp:1404

References TAnimal::CheckManagement(), ClDying(), and DailyMortality().

◆ ClDeveloping()

Partridge_State Partridge_Clutch::ClDeveloping ( void  )
private

Development state.

This method controls the development of the clutch and its hatching. Hatching occurs when the clutch has been incubated for a predefined period.
Timing: Occurs at the end of a day (e.g. midnight-1 minute). Must create Clutch_Size number of Partridge_Chick Objects. They tell their mother that they have been created when they exist in the system.

539 {
541  if ( ++m_age < cfg_par_incubation_period.value() ) {
542  return pars_ClDeveloping;
543  }
544  //The line below is really debug information, this identifies the caller
546  // Call the mother via the message centre
549  // Remove the infertile eggs
550  int clutchsize = 0;
551  // correct for infertile eggs:
552  for ( int u = 0; u < m_clutch_size; u++ ) {
553  if ( g_rand_uni() >= cfg_par_infertile_eggs.value() ) clutchsize++;
554  }
555  if ( clutchsize == 0 ) // all infertile
556  {
558  m_StepDone = true; // Note this does more than stop the Step code executing
559  m_covey->NestLeave(); // indicate that we are finished with the nest
560  m_covey->RemoveMember( this );
561  m_mother = NULL; // just in case they get some other weird message
562  m_CurrentStateNo = -1;
563  return pars_Destroy;
564  }
565  // Call the mother via the message centre
567  // Do what is needed to create the new chick objects
568  // m_OurPopulationManager->AddMaturedE();
569  Chick_struct * Ch;
570  Ch = new Chick_struct;
571  Ch->x = m_Location_x;
572  Ch->y = m_Location_y;
573  Ch->bx = m_Location_x;
574  Ch->by = m_Location_y;
575  Ch->Mum = m_mother;
576  Ch->m_covey = m_covey;
578  m_OurPopulationManager->CreateObjects( pob_Chick, Ch, clutchsize );
579  delete Ch;
580  m_CurrentStateNo = -1;
582  m_StepDone = true; // Note this does more than stop the Step code executing
583  m_covey->NestLeave(); // indicate that we are finished with the nest
584  m_covey->RemoveMember( this );
585  m_mother = NULL; // just in case they get some other weird message and try
586  // to do something with the mother pointer
587  //m_covey->SanityCheck2(m_covey->GetOurChicks() );
588  return pars_Destroy;
589 }
static CfgInt cfg_par_incubation_period("PAR_INCUBATION_PERIOD", CFG_CUSTOM, 24)
Lenght of incubation period.
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
static CfgFloat cfg_par_infertile_eggs("PAR_INFERTILE_EGGS", CFG_CUSTOM, 0.08)
Proportion of infertile eggs.
@ pars_ClDeveloping
Definition: Partridge_All.h:273
@ pars_Destroy
Definition: Partridge_All.h:287
@ pob_Chick
Definition: Partridge_All.h:297
@ pcomm_EggsHatch
Definition: Partridge_Communication.h:61
@ pcomm_AllInfertile
Definition: Partridge_Communication.h:60
double value(void)
Definition: configurator.h:118
int value(void)
Definition: configurator.h:98
Struct to pass chick information.
Definition: Partridge_All.h:374
Partridge_Female * Mum
Definition: Partridge_All.h:376
int m_age
Age in days.
Definition: Partridge_All.h:410
Partridge_Covey * m_covey
Pointer to the covey.
Definition: Partridge_All.h:420
int m_family_counter
Family ID.
Definition: Partridge_All.h:408
void NestLeave(void)
Leave the nest
Definition: Partridge_Covey.h:516
int RemoveMember(Partridge_Base *a_former_member)
Remove a member from the covey.
Definition: Partridge_Covey.cpp:1664
Partridge_Male * GetMate(void)
Supply mate pointer.
Definition: Partridge_All.h:872
void AddHatchSuccess(int sz)
Definition: Partridge_Population_Manager.h:228
void CreateObjects(int ob_type, Partridge_struct *data, int number)
Definition: Partridge_Population_Manager.cpp:368
int by
Definition: Partridge_All.h:347
Partridge_Covey * m_covey
Definition: Partridge_All.h:349
int x
Definition: Partridge_All.h:344
int bx
Definition: Partridge_All.h:346
int y
Definition: Partridge_All.h:345
int family_counter
Definition: Partridge_All.h:350
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Partridge_Male * m_male
Definition: Partridge_Communication.h:83

References Partridge_Population_Manager::AddHatchSuccess(), Partridge_struct::bx, Partridge_struct::by, cfg_par_incubation_period, cfg_par_infertile_eggs, Partridge_Population_Manager::CreateObjects(), Partridge_struct::family_counter, g_rand_uni, Partridge_Female::GetMate(), Partridge_Base::m_age, PartridgeCommunicationData::m_clutch, m_clutch_size, Partridge_Population_Manager::m_comms_data, Partridge_struct::m_covey, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, Partridge_Base::m_family_counter, PartridgeCommunicationData::m_female, TAnimal::m_Location_x, TAnimal::m_Location_y, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_mother, Partridge_Base::m_OurPopulationManager, TALMaSSObject::m_StepDone, m_underincubation, Chick_struct::Mum, Partridge_Covey::NestLeave(), pars_ClDeveloping, pars_Destroy, Partridge_Communication::PassMessage(), pcomm_AllInfertile, pcomm_EggsHatch, pob_Chick, Partridge_Covey::RemoveMember(), CfgInt::value(), CfgFloat::value(), Partridge_struct::x, and Partridge_struct::y.

Referenced by EndStep().

◆ ClDying()

void Partridge_Clutch::ClDying ( void  )
private

Dying state.

Removes the clutch from the system after doing any necessary house-keeping.

597 {
598  // Before this method is called all necessary communications need to be carried
599  // out
600  // All the housekeeping necessary to die
601  if ( m_CurrentStateNo == -1 ) return; // already killed by something else
602  m_CurrentStateNo = -1;
603  m_StepDone = true;
604  // Do any statistics recording
606  // Now tidy up before vanishing totally
607  m_mother = NULL;
608  m_covey->RemoveMember( this );
610 }
Partridge_State m_state
Current behavioural state.
Definition: Partridge_All.h:422
void incNoDeadClutches()
Definition: Partridge_All.h:160

References population_attributes::incNoDeadClutches(), Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, m_mother, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, Partridge_Base::m_state, TALMaSSObject::m_StepDone, k_factors::m_ThisYear, pars_Destroy, and Partridge_Covey::RemoveMember().

Referenced by AgDying(), BeginStep(), Dying(), OnEaten(), OnGivenUp(), and OnMumDead().

◆ DailyMortality()

bool Partridge_Clutch::DailyMortality ( void  )
virtual

Background mortality test.

No functionality any longer because this is done in the female incubtation due to the need to have density-dependence calculated first.

Reimplemented from Partridge_Base.

355 {
356  return false;
357 }

Referenced by BeginStep().

◆ Dying()

virtual void Partridge_Clutch::Dying ( )
inlinevirtual

Generic dying handler.

Reimplemented from TAnimal.

532  {
533  ClDying();
534  }

References ClDying().

◆ EndStep()

void Partridge_Clutch::EndStep ( void  )
virtual

Clutch EndStep.

Does the development for the clutch here.

Reimplemented from TAnimal.

328 {
329  if ( m_CurrentStateNo == -1 )
330  return;
331 
332  switch ( m_state )
333  {
334  case pars_ClDeveloping:
335  m_state = ClDeveloping();
336  break;
337  case pars_ClHatching:
338  break;
339  case pars_ClDying:
340  break;
341  case pars_Destroy:
342  // Destroy is only called if all housekeeping wrt to removal of the object
343  // is done - object will be destroyed by PopulationManager
344  break;
345  default:
346  m_OurLandscape->Warn( "Partridge_Clutch::EndStep - unknown pars type", NULL );
347  exit( 1 );
348  }
349 }
@ pars_ClDying
Definition: Partridge_All.h:273
@ pars_ClHatching
Definition: Partridge_All.h:273
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Partridge_State ClDeveloping(void)
Development state.
Definition: Partridge_All.cpp:538
Landscape * m_OurLandscape
Definition: PopulationManager.h:229

References ClDeveloping(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, pars_ClDeveloping, pars_ClDying, pars_ClHatching, pars_Destroy, and Landscape::Warn().

◆ GetClutchSize()

int Partridge_Clutch::GetClutchSize ( void  )
inline

Supply no eggs.

561  {
562  return m_clutch_size;
563  }

References m_clutch_size.

◆ GetMother()

Partridge_Female* Partridge_Clutch::GetMother ( void  )
inline

Supply mother pointer.

566  {
567  return m_mother;
568  }

References m_mother.

◆ OnEaten()

void Partridge_Clutch::OnEaten ( void  )

Message handler.

Response to a pcomm_ClutchEaten

646 {
647  if ( m_mother ) // if this is NULL the clutch is alread dying
648  {
649  ClDying();
650  }
651 }

References ClDying(), and m_mother.

Referenced by Partridge_Communication::PassMessage().

◆ OnFarmEvent()

bool Partridge_Clutch::OnFarmEvent ( FarmToDo  event)
virtual

Handle farm event.

Chooses the response to external management events. Responses can either be set via config variables or directly here.

Reimplemented from TAnimal.

381 {
382  switch ( event )
383  {
384  case sleep_all_day:
385  break;
386  case autumn_plough:
387  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
388  break;
389  case autumn_harrow:
390  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
391  break;
392  case autumn_roll:
393  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
394  break;
395  case autumn_sow:
396  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
397  break;
398  case winter_plough:
399  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
400  break;
401  case deep_ploughing:
402  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
403  break;
404  case spring_plough:
405  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
406  break;
407  case spring_harrow:
408  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
409  break;
410  case spring_roll:
411  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
412  break;
413  case spring_sow:
414  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
415  break;
416  case fp_npks:
417  break;
418  case fp_npk:
419  break;
420  case fp_pk:
421  break;
422  case fp_liquidNH3:
423  if ( g_rand_uni() < 80 ) AgDying();
424  break;
425  case fp_slurry:
426  if ( g_rand_uni() < 50 ) AgDying();
427  break;
429  break;
430  case fp_manure:
431  if ( g_rand_uni() < 0.20 ) AgDying();
432  break;
433  case fp_greenmanure:
434  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
435  break;
436  case fp_sludge:
437  break;
438  case fa_npk:
439  break;
440  case fa_pk:
441  break;
442  case fa_slurry:
443  if ( g_rand_uni() < 0.50 ) AgDying();
444  break;
445  case fa_ammoniumsulphate:
446  break;
447  case fa_manure:
448  if ( g_rand_uni() < 0.20 ) AgDying();
449  break;
450  case fa_greenmanure:
451  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
452  break;
453  case fa_sludge:
454  break;
455  case herbicide_treat:
456  break;
457  case growth_regulator:
458  break;
459  case fungicide_treat:
460  break;
462  case insecticide_treat:
463  case product_treat:
464  case glyphosate:
465  break;
466  case molluscicide:
467  break;
468  case row_cultivation:
469  if ( g_rand_uni() < 0.50 ) AgDying();
470  break;
471  case strigling:
472  break;
473  case hilling_up:
474  if ( g_rand_uni() < 0.50 ) AgDying();
475  break;
476  case water:
477  if ( g_rand_uni() < 0.01 ) AgDying();
478  break;
479  case swathing:
480  break;
481  case harvest:
482  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
483  break;
484  case cattle_out:
485  break;
486  case cattle_out_low:
487  break;
488  case cut_to_hay:
489  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
490  break;
491  case cut_to_silage:
492  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
493  break;
494  case straw_chopping:
495  break;
496  case hay_turning:
497  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
498  break;
499  case hay_bailing:
500  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
501  break;
502 
503  case stubble_harrowing:
504  break;
506  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
507  break;
508  case burn_straw_stubble:
509  break;
510  case mow:
511  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
512  break;
513  case cut_weeds:
514  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
515  break;
516  case pigs_out:
517  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
518  break;
519  case strigling_sow:
520  if ( g_rand_uni() < cfg_par_cl_cut.value() ) AgDying();
521  break;
522  default:
523  m_OurLandscape->Warn( "Skylark_Clutch::OnFarmEvent(): Unknown event type:", m_OurLandscape->EventtypeToString( event ) );
524  exit( 1 );
525  }
526  if ( m_state == pars_Destroy ) return true;
527  else
528  return false;
529 }
static CfgFloat cfg_par_cl_cut("PAR_CL_CUT_MORT", CFG_CUSTOM, 0.29)
Clutch % mortality on cutting.
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
void AgDying()
Killed by management.
Definition: Partridge_All.cpp:364
@ burn_straw_stubble
Definition: treatment.h:92
@ autumn_harrow
Definition: treatment.h:37
@ swathing
Definition: treatment.h:81
@ fa_pk
Definition: treatment.h:62
@ winter_plough
Definition: treatment.h:42
@ strigling
Definition: treatment.h:77
@ fp_npks
Definition: treatment.h:48
@ glyphosate
Definition: treatment.h:102
@ fa_sludge
Definition: treatment.h:68
@ fp_liquidNH3
Definition: treatment.h:51
@ spring_roll
Definition: treatment.h:46
@ fa_greenmanure
Definition: treatment.h:67
@ spring_plough
Definition: treatment.h:44
@ molluscicide
Definition: treatment.h:75
@ syninsecticide_treat
Definition: treatment.h:99
@ hay_turning
Definition: treatment.h:88
@ autumn_roll
Definition: treatment.h:38
@ fp_manure
Definition: treatment.h:55
@ deep_ploughing
Definition: treatment.h:43
@ pigs_out
Definition: treatment.h:84
@ fa_npk
Definition: treatment.h:61
@ herbicide_treat
Definition: treatment.h:71
@ row_cultivation
Definition: treatment.h:76
@ spring_sow
Definition: treatment.h:47
@ fungicide_treat
Definition: treatment.h:73
@ fp_manganesesulphate
Definition: treatment.h:53
@ harvest
Definition: treatment.h:82
@ cut_to_silage
Definition: treatment.h:86
@ sleep_all_day
Definition: treatment.h:33
@ mow
Definition: treatment.h:93
@ fa_ammoniumsulphate
Definition: treatment.h:65
@ autumn_plough
Definition: treatment.h:34
@ straw_chopping
Definition: treatment.h:87
@ fa_manure
Definition: treatment.h:66
@ fp_greenmanure
Definition: treatment.h:56
@ fa_slurry
Definition: treatment.h:63
@ product_treat
Definition: treatment.h:101
@ stubble_harrowing
Definition: treatment.h:90
@ hilling_up
Definition: treatment.h:79
@ growth_regulator
Definition: treatment.h:72
@ insecticide_treat
Definition: treatment.h:74
@ cattle_out_low
Definition: treatment.h:100
@ cut_to_hay
Definition: treatment.h:85
@ cut_weeds
Definition: treatment.h:94
@ fp_sludge
Definition: treatment.h:57
@ autumn_sow
Definition: treatment.h:41
@ fp_npk
Definition: treatment.h:49
@ fp_pk
Definition: treatment.h:50
@ hay_bailing
Definition: treatment.h:89
@ spring_harrow
Definition: treatment.h:45
@ strigling_sow
Definition: treatment.h:95
@ cattle_out
Definition: treatment.h:83
@ fp_slurry
Definition: treatment.h:52
@ water
Definition: treatment.h:80
@ autumn_or_spring_plough
Definition: treatment.h:91

References AgDying(), autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, burn_straw_stubble, cattle_out, cattle_out_low, cfg_par_cl_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_greenmanure, fa_manure, fa_npk, fa_pk, fa_sludge, fa_slurry, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_sludge, fp_slurry, fungicide_treat, g_rand_uni, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, Partridge_Base::m_state, molluscicide, mow, pars_Destroy, pigs_out, product_treat, row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, straw_chopping, strigling, strigling_sow, stubble_harrowing, swathing, syninsecticide_treat, CfgFloat::value(), Landscape::Warn(), water, and winter_plough.

◆ OnGivenUp()

void Partridge_Clutch::OnGivenUp ( void  )

Message handler.

Called as a direct call from Partridge_Female::OnMateDying

632 {
633  if ( m_mother ) // if this is NULL the clutch is alread dying
634  {
635  m_mother = NULL;
636  ClDying();
637  }
638 }

References ClDying(), and m_mother.

Referenced by Partridge_Female::OnMateDying().

◆ OnMumDead()

void Partridge_Clutch::OnMumDead ( void  )

Message handler.

Response to a pcomm_MumDeadC message.

618 {
619  if ( m_mother ) // if this is NULL the clutch is already dying
620  {
621  m_mother = NULL;
622  }
623  ClDying();
624 }

References ClDying(), and m_mother.

Referenced by Partridge_Communication::PassMessage().

◆ OnStartIncubating()

void Partridge_Clutch::OnStartIncubating ( )
inline

Flag under incubation.

536 { m_underincubation = true; }

References m_underincubation.

Referenced by Partridge_Female::FLaying().

◆ SetClutchSize()

void Partridge_Clutch::SetClutchSize ( int  cs)
inline

Set no. eggs.

556  {
557  m_clutch_size=cs;
558  }

References m_clutch_size.

Referenced by Partridge_Female::FLaying().

◆ Step()

void Partridge_Clutch::Step ( void  )
virtual

ClutchStep.

Does little here except initiating behaviour and ensuring m_StepDone is true on death.

Reimplemented from TAnimal.

298 {
299  if ( m_CurrentStateNo == -1 || m_StepDone )
300  return;
301 
302 #ifdef __PAR_DEBUG
304 #endif
305 
306  switch ( m_state )
307  {
308  case pars_Initiation:
310  case pars_ClDeveloping:
311  case pars_ClHatching:
312  case pars_Destroy:
313  case pars_ClDying:
314  m_StepDone = true;
315  break;
316  default:
317  m_OurLandscape->Warn( "Partridge_Clutch::Step - unknown pars type", NULL );
318  exit( 1 );
319  }
320 }
@ pars_Initiation
Definition: Partridge_All.h:267
virtual void CheckMatePointers()
Debug.
Definition: Partridge_All.h:426

References Partridge_Base::CheckMatePointers(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, TALMaSSObject::m_StepDone, pars_ClDeveloping, pars_ClDying, pars_ClHatching, pars_Destroy, pars_Initiation, and Landscape::Warn().

Member Data Documentation

◆ m_clutch_size

int Partridge_Clutch::m_clutch_size
private

◆ m_mother

Partridge_Female* Partridge_Clutch::m_mother
private

◆ m_underincubation

bool Partridge_Clutch::m_underincubation
private

Are we being incubated?

Referenced by ClDeveloping(), OnStartIncubating(), and Partridge_Clutch().


The documentation for this class was generated from the following files: